package com.cyf.db.mapper;

import com.cyf.db.bean.CityguidanceLed;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Created by cheyifu on 2018/2/6.
 */
public interface CityguidanceLedParkingMapper {

    //根据parkingId查找LEd的id
    @Select("select " +
            "cl.areaId,cl.color,cl.dtuId,cl.id " +
            "from " +
            "cityguidance_led as cl,cityguidance_led_parking as clp " +
            "where " +
            "clp.parkingId = #{parkingId} and clp.ledId = cl.id;;")
    List<CityguidanceLed> getLedByParkingId(@Param("parkingId") int parkingId);

    //根据LED的id查找parkingId
    @Select("select parkingId from cityguidance_led_parking where ledId = #{ledId}")
    List<Integer> getParkingIdByLedId(@Param("ledId") int ledId);
}
